<?php


if (!defined("EXPONENT")) exit("");

$gallery = null;
if (isset($_GET['id'])) {
	$gallery = $db->selectObject("imagegallery_gallery","id=".$_GET['id']);
}

if ($gallery) {
	$loc = unserialize($gallery->location_data);
	$loc->int = $gallery->id;
	
	if (exponent_permissions_check("delete",$loc)) {
		$db->delete("imagegallery_gallery","id=".$gallery->id);
		exponent_flow_redirect();
	} else {
		echo SITE_403_HTML;
	}
} else echo SITE_404_HTML;

?>